package service

import (
	"github.com/crack007/go-im/src/common/dao"
	"github.com/crack007/go-im/src/common/entity"
	"github.com/crack007/go-im/src/common/model"
)

type noticeService struct {
}

// 站内信推送
func (s *noticeService) PushNotice(noticeModel *model.NoticeModel) {
	// TODO 站内信推送，需要异步方案
	noticeEntity := entity.NewNoticeEntity()
	noticeEntity.Title = noticeModel.Title
	noticeEntity.Content = noticeModel.Content
	noticeEntity.UserID = noticeModel.UserId
	noticeEntity.FromUserId = noticeModel.FromUserId
	dao.NoticeDao.Save(noticeEntity)
}
